from flask import Flask
from .config import app_config
from . import models, views, auth


def create_app(env_name):
    # create and configure the app
    app = Flask(__name__)
    print("env: ", env_name)
    app.config.from_object(app_config[env_name])
    models.init_app(app)
    auth.init_app(app)
    views.init_app(app)
    return app
